Page({
  data: {
    messageOne: '会员直接导购，点此',
    messageTwo: '客服',
    classify: ['热推商品', '自营超市', '自营套餐', '自营其他类', '外部商品', '会员商品', '积分商品', '搜索'],
    defaultIndex: 0,
    color: 'none',
    productList: [{
        id: '1',
        name: '热销商品1',
        image: '../../images/product1.jpg',
        price: '20'
      }, {
        id: '2',
        name: '热销商品2',
        image: '../../images/product1.jpg',
        price: '30'
      }, {
        id: '3',
        name: '热销商品3',
        image: '../../images/product1.jpg',
        price: '40'
      }
    ]
  },
  onLoad(){
    wx.getSystemInfo({
      success: res => {
        this.setData({
          scrollHeight: res.windowHeight + 'px',
          scrollLeftWidth: res.windowWidth/4 + 'px',
          scrollRightWith: res.windowWidth/4*3 + 'px'
        })
      }
    })
  },
  onTapClick(e){
    let index = e.currentTarget.dataset.index
    // console.log(index)
    this.setData({
      defaultIndex: index
    })
  }
})